package com.lhd_gm.scheduledtasksystem.service;

import com.lhd_gm.scheduledtasksystem.pojo.JobInfo;
import com.lhd_gm.scheduledtasksystem.pojo.ScheduledHttpTask;
import org.quartz.Trigger;

public interface QuartzService {
    //新增Job
    String addCronJob(JobInfo jobInfo, String jobClassName);

    //新增HttpJob
    String addHttpCronJob(JobInfo jobInfo, String jobClassName, String shtJson);

    //新增shellJob
    String addShellCronJob(JobInfo jobInfo, String jobClassName, String stJson, String shellPath);

    //修改Job
    String modifyJob(JobInfo jobInfo);

    //删除Job
    String deleteCronJob(JobInfo jobInfo);

    //立即执行Job，不定时
    String executeImmediately(JobInfo jobInfo, String jobClassName);

    //暂停Job
    public int pauseJob(String jobName, String jobGroup);

    //暂停单个触发器
    public int pauseTrigger(String triggerName, String triggerGroup);

    //恢复Job
    public int resumeJob(String jobName, String jobGroup);

    //恢复单个触发器
    public int resumeTrigger(String triggerName, String triggerGroup);

    //获取任务状态
    public Trigger.TriggerState getTriggerState(String triggerName, String triggerGroup);
}
